<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Income;
use DB;
class InComeController extends Controller
{
    public function index(Request $request)
    {
        $user = $request->user();
        $data = DB::table('income')
            ->leftjoin('trades','income.tid','=','trades.id')
            ->select('income.*','trades.*','income.created_at as created ')
            ->where('aid',$user->id)->orderBy('income.id','desc')->paginate(20);


        return view('income.list',[
            'data' => $data,
        ]);
    }
}
